define(
   [
      'dojo/_base/declare',
      'dojo/_base/lang'
   ],
   function(declare, lang)
   {
      return declare([],
      {
         /*
            This helper class expects the icons classes to have been made by the create_css_sprites.php script
            available on the "zend" side of this library.
         */

         mDojoFrameworkPath: "/js/dojo/dojoFramework",

         constructor:function(args)
         {
            dojo.safeMixin(this, args);
         },
         postscript: function(args)
         {
            this.inherited(arguments);
         },
         getIconClass: function(image)
         {
            var indexOfFileType  = image.indexOf('.');
            if(indexOfFileType == -1)
               return null;
      
            var file             = image.substring(0, indexOfFileType);
            var className = file.replace(/\//g, "-");
      
            return className;
         },
         getImage: function(image, style)
         {
            if(!style)
               style = "";
            var iconClass = this.getIconClass(image);
            return '<img ' + style + 'src="' + this.mDojoFrameworkPath  + '/dojo/resources/blank.gif" alt="" class="dijitIcon ' + iconClass  + '" />';
         }
      });
   }
);
